//Author: Simona Conley Date Started: March 26th and Last date Modified: April 5th


<?php
$dbConn=odbc_connect('EventDB','','');
$sql="SELECT title, cust_Fname, cust_Lname, m.i, street address, city, state, zip, day Phone, evening phone, email";
$rs=odbc_exec($dbConn, $sql);
while($row=odbc_fetch_row($rs))
{
?>
<tr>
<td><input type="checkbox"name="<?php echo $row[title];?>"value=""></td>
<td><?php echo$row[cust_Fname];?></td>
<td><?php echo$row[cust_Lname];?></td>
<td><?php echo?row[street address];?></td>
<td><?php echo?row[city];?></td>
<td><?php echo?row[state];?></td>
<td><?php echo?row[zip];?></td>
<td><?php echo?row[day phone];?></td>
<td><?php echo?row[evening phone];?></td>
<td><?php echo?row[email];?></td>
</tr>
<?php>
?>
</table>
<input type="submit"name="submit"value="Delete Selected">
<?php>
$dbConn=odbc_connect('EventDB','','');
//check if form been submitted
if(isset($_POST['submit']))
{
for($count=0;$count<count($_POST['email']);$count++)
//loop through each customer with check by it
{
$email=$_POST['email'][$count];
echo"This is the Email $email";
$sql="DELETE FROM customer WHERE email="'.email'"";
$rs = odbc_exec($dbConn,$sql);
//check for changes
if((odbc_affected_rows90==0)||odbc_affected_rows()==-1)
{
echo"<p>There was a problem deleting</p>";
exit;
}
}
echo"<p>The selected clients were successfully deleted!</p>";
}
?>
